'use strict';
function includes(collection,ch){
  for(let item of collection){
    if(item==ch){
      return true;
    }
  }
}
function collectSameElements(collectionA, collectionB){
  let result=[];
  for(let item of collectionA){
    if(includes(collectionB,item)){
      result.push(item);
    }
  }
  console.log(result);
  return result;
}
module.exports =  collectSameElements;
collectSameElements(['a', 'e', 'h', 't', 'f', 'c', 'g', 'b', 'd'],['a', 'd', 'e', 'f']);

